﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JQuery.Net.UI
{
    public class Templates
    {
        private jQNetControl _ctrl = null;
        private Dictionary<string,Template>  _container = null;

        public Templates(jQNetControl ctrl)
        {
            _ctrl = ctrl;
            _container = new Dictionary<string,Template>();
        }

        public Template this[string id]
        {
            get
            {
                if (_container.ContainsKey(id)) 
                    return _container[id];
                else return null;
            }
            set
            {
                if (!_container.ContainsKey(id))
                {
                    _container.Add(id, value);
                }
                else _container[id] = value;
            }

        }

        public bool HasTemplates
        {
            get { return _container.Count > 0; }
        }
    }
}
